package com.example.shouybl.fragment;


import android.content.Intent;
import android.os.Bundle;

import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.shouybl.BaseApp;
import com.example.shouybl.R;
import com.example.shouybl.ui.SystemSetActivity;

/**
 * A simple {@link Fragment} subclass.
 */
public class MyFragment extends Fragment {

    //title布局相关
    private ImageView ivLeft;
    private TextView tvTitle;
    private ImageView ivRight;
    private Button btnRight;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v=inflater.inflate(R.layout.fragment_my, container, false);
        initView(v);
        return v;
    }

    private void initView(View v) {
        //主体变量
        TextView tvSet= (TextView) v.findViewById(R.id.tv_system_setting);
        tvSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(BaseApp.getInstance(), SystemSetActivity.class);
                startActivity(intent);
            }
        });
        //title变量
        ivLeft = (ImageView) v.findViewById(R.id.iv_left);
        tvTitle = (TextView) v.findViewById(R.id.tv_title);
        ivRight = (ImageView) v.findViewById(R.id.iv_right);
        btnRight = (Button) v.findViewById(R.id.btn_right);
        ivLeft.setVisibility(View.GONE);
        tvTitle.setText("我的信息");
        ivRight.setVisibility(View.GONE);
        btnRight.setVisibility(View.GONE);
    }


}
